package io.gitee.zicai.bus.sample.adaptor;

import io.gitee.zicai.bus.bus.EventSendBus;
import io.gitee.zicai.bus.sample.cmd.CmdSendParam;
import io.gitee.zicai.bus.sample.cmd.ICmdSender;

import java.util.function.BiConsumer;

/**
 * CmdSendBus
 *
 * @author zicai
 * @since 2021-04-02
 */
public class CmdSendBus extends EventSendBus<ICmdSender, CmdSendParam> {

    public CmdSendBus(CmdSendParam sendParam) {
        super(sendParam);
    }

    public static CmdSendBus of(CmdSendParam sendParam) {
        return new CmdSendBus(sendParam);
    }

    @Override
    public BiConsumer<ICmdSender, CmdSendParam> send() {
        return sendParam.getCmdEnum().cmdSender;
    }
}
